package jhavelogger.visitor;

import jhavelogger.models.AcceptedConnection;
import jhavelogger.models.UsernameLookup;
import jhavelogger.models.JHaveLog;
import jhavelogger.models.SendAlgorithmToClient;
import jhavelogger.models.UidOperation;
import jhavelogger.visitor.logInterfaces.VisitsAcceptedConnection;
import jhavelogger.visitor.logInterfaces.VisitsAlgorithmLookup;
import jhavelogger.visitor.logInterfaces.VisitsSendAlgorithmToClient;
import jhavelogger.visitor.logInterfaces.VisitsUidOperation;

/**
 * A simple visitor that returns the visited logs as strings
 * 
 * @author Jared Schlicht
 */
public class DebuggingVisitor extends LogVisitor implements VisitsAcceptedConnection, VisitsAlgorithmLookup, VisitsUidOperation, VisitsSendAlgorithmToClient {
    @Override
    public Object visit(AcceptedConnection log) {
	return log.toString();
    }

    @Override
    public Object visit(UsernameLookup log) {
	return log.toString();
    }

    @Override
    public Object visit(UidOperation log) {
	return log.toString();
    }

    @Override
    public Object visit(SendAlgorithmToClient log) {
	return log.toString();
    }
    
    @Override
    public Object defaultVisit(JHaveLog log) {
	return "Unknown log type";
    }
}
